
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 0787
 * @Author : WangRuoyu 
 * @Date : 2023/5/20 10:23
 */

#include "iostream"

using namespace std;

const int N = 1e6 + 10;

int tmp[N];

void merge_sort(int a[], int l, int r) {
    if (l >= r) return;
    int mid = l + r >> 1;
    merge_sort(a, l, mid);
    merge_sort(a, mid + 1, r);

    int cnt = 0;
    int i = l;
    int j = mid + 1;
    while (i <= mid && j <= r) {
        if (a[i] < a[j]) tmp[cnt++] = a[i++];
        else tmp[cnt++] = a[j++];
    }
    while (i <= mid) tmp[cnt++] = a[i++];
    while (j <= r) tmp[cnt++] = a[j++];

    for (int k = 0; k < cnt; ++k) {
        a[l + k] = tmp[k];
    }
}

int main() {
    int n;
    scanf("%d", &n);
    int a[n];
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
    }
    merge_sort(a, 0, n - 1);
    for (int i = 0; i < n; ++i) {
        printf("%d ", a[i]);
    }
    return 0;
}